#pragma once
#include <Rz/Object.h>
#include <Rz/Graphics/Render/IEffect.h>
#include <Rz/Graphics/Render/IEffectProperty.h>
#include <Rz/Graphics/Render/IDeviceResource.h>

namespace Rz { namespace Graphics { namespace Effects {

// REVIEW: interface?
class EffectBase :
	public Object,
	public Render::IDeviceResource
{
	public:
		RZ_RTTI(Rz::Graphics::Effects, EffectBase);
		RZ_RTTI_IMPLEMENTS(Object);
		RZ_RTTI_END;

		virtual const Render::IEffect* GetEffect() const;
		virtual Render::IEffect* GetEffect();
		virtual void SetEffect(Render::IEffect* effect);

		virtual void Apply() = 0;

		Ptr<Render::IEffectProperty> pProjectionMatrix;
		Ptr<Render::IEffectProperty> pViewMatrix;
		Ptr<Render::IEffectProperty> pModelMatrix;
		Ptr<Render::IEffectProperty> pProjectionViewMatrix;
		Ptr<Render::IEffectProperty> pProjectionViewModelMatrix;
		Ptr<Render::IEffectProperty> pNormalMatrix;
		Ptr<Render::IEffectProperty> pEyeDirection;
		Ptr<Render::IEffectProperty> pEyePosition;
		Ptr<Render::IEffectProperty> pWindowSize;
		Ptr<Render::IEffectProperty> pNearFar;

	protected:
		EffectBase(Render::IRenderDevice* renderDevice);

		Ptr<Render::IEffect> _effect;
};

} } }
